﻿using GamovMvc.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GamovMvc
{
    /// <summary>
    /// Index 的摘要说明
    /// </summary>
    public class Index : IHttpHandler
    {

        public bool IsReusable => false;

        public void ProcessRequest(HttpContext context)
        {
            var controllerName = context.Request.QueryString["controller"];
            IController controller = null;
            if (string.IsNullOrEmpty(controllerName))
            {
                controllerName = "home";
            }

            switch (controllerName)
            {
                case "home":
                    controller = new HomeController();
                    break;
                case "product":
                    controller = new ProductController();
                    break;
                default:
                    break;
            }
            //controller.Execute(context);
        }
    }
}